<html>
<head>
    <title>Indent XML</title>

</head>
<body>

<div>
    <textarea name="text1" id="text1" cols="30" rows="10"></textarea>
</div>
<div>
    <input type="button" id ="btn" onclick="test()">
</div>
<div>
    <textarea name="text2" id="text2" cols="30" rows="10"></textarea>
</div>

<script src="../../plugins/jQuery/jquery-2.2.3.min.js"></script>
<script>
    function test() {
        var text1 = document.getElementById("text1");
        var text2 = document.getElementById("text2");

        $.get("/abb/xml/format?str=%3CRequestData%3E%3werweCHeadData%3E%asdrfsserr3CUserCode%3Esh1_admin%3C/UserCode%3E%3CUserName%3Esh1_admin%3C/UserName%3E%3CUserCompanyCode%3E3107%3C/UserCompanyCode%3E%3CUserCompanyName%3E%E4%B8%8A%E6%B5%B7%E5%88%86%E5%85%AC%E5%8F%B8%E4%B8%80%E9%83%A8%3C/UserCompanyName%3E%3CRequestType%3E03%3C/RequestType%3E%3C/HeadData%3E%3CBodyData%3E%3CReportId%3E113100000033%3C/ReportId%3E%3CInsurant%3Ea5rfg87%3C/Insurant%3E%3CNumberPlate%3E%E6%B2%AAE78612%3C/NumberPlate%3E%3CEngineModel%3E%3C/EngineModel%3E%3CCarVin%3E%3C/CarVin%3E%3CAccidentDate%3E2011-02-25%2015:07:00%3C/AccidentDate%3E%3CReportDate%3E2011-02-25%2015:07:00%3C/ReportDate%3E%3CProvince%3E310000%3C/Province%3E%3CCity%3E310100%3C/City%3E%3CDistrict%3E%3C/District%3E%3CAccidentPlace%3E1%3C/AccidentPlace%3E%3CAccidentLongitude%3E%3C/AccidentLongitude%3E%3CAccidentLatitude%3E%3C/AccidentLatitude%3E%3CSurveyLongitude%3E%3C/SurveyLongitude%3E%3CSurveyLatitude%3E%3C/SurveyLatitude%3E%3CSceneReportFlag%3E%3C/SceneReportFlag%3E%3CReporter%3E%3C/Reporter%3E%3CReporterTel%3E%3C/ReporterTel%3E%3CSurveyPlace%3E%3C/SurveyPlace%3E%3COperatorId%3E3525%3C/OperatorId%3E%3COperatorName%3Esh_admin%3C/OperatorName%3E%3CReportDealId%3E30000800%3C/ReportDealId%3E%3CReportDealName%3E%E6%B1%9F%E8%8B%8F%E5%88%86%E5%85%AC%E5%8F%B8%3C/ReportDealName%3E%3CCompanyName%3E%3C/CompanyName%3E%3CCustomerTypeCode%3E%3C/CustomerTypeCode%3E%3CForcePolicyId%3Ea5rfg87a5rfg87a5rfg87%3C/ForcePolicyId%3E%3CBizPolicyId%3E%3C/BizPolicyId%3E%3CIndex%3E0%3C/Index%3E%3CFieldName%3E5%3C/FieldName%3E%3C/BodyData%3E%3C/RequestData%3E",function (data,status) {
            text2.value = data;
        })

    }

</script>
</body>
</html>